import { createApp,ref,watch,computed } from 'vue'
import { createPinia } from 'pinia';
import App from './App.vue'
import { createRouter, createWebHistory } from 'vue-router'

// 导入全局样式
import '@/assets/styles.css';
const pinia = createPinia();
// 初始化Vue应用
const app = createApp(App)
const router = createRouter({
  history: createWebHistory('/'),
  routes: [
    { path: '/', component: App },
    // 添加404回退路由
    { path: '/:pathMatch(.*)*', redirect: '/' }
  ]
})
// 配置全局API
app.config.globalProperties.$ref = ref;
app.config.globalProperties.$computed = computed;
app.config.globalProperties.$watch = watch;
// 配置全局属性
app.config.globalProperties.$appVersion = '1.0.0'
app.use(router)
app.use(pinia);
// 挂载应用
app.mount('#app')